#include<stdio.h>
#include<stdlib.h>
int table(int x)
{
	if(x%4==0&&x%100!=0||x%400==0)
		return 1;
	else
	return 0;
}
int main()
{
	int year = 0;
	int i = 0;
	//scanf("%d",&year);
	for(year=1000;year<2001;year++)
	{
		
		if(table(year))
		printf("%d ",year);
	}
	system("pause");
	return 0;
}